#include("common.html")
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>商城</title>
    
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/vant.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/filter.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/mui/css/mui.css"/>
    <script type="text/javascript" src="#(tpath)/static/js/jquery.js"></script>
    <script type="text/javascript" src="#(tpath)/static/mui/js/mui.js"></script>
  </head>
  
  <body class="">
    <style type="text/css">@media only screen and (min-width: 320px){ html { font-size: 62.5% !important; } } @media only screen and (min-width: 640px){ html { font-size: 125% !important; } } @media only screen and (min-width: 750px){ html { font-size: 150% !important; } } @media only screen and (min-width: 1242px){ html { font-size: 187.5% !important; } }</style>
    <style>.van-card{background:#fff;margin-bottom: 10px;} .van-card__content{height: 70px;} .van-card__thumb{ width: 60px; height: 60px; } .no-data{ width: 100%; height:100%; padding-top: 70px; text-align: center; font-size: 12px; color: #d9d9d9; } .collect{ padding:0 16px; background:#fff; } .collect-item{ overflow: hidden; padding:16px 0; border-bottom:1px #eee solid; } .collect-img{ float:left; width:30%; } .collect-R{ float:left; width:70%; font-size:12px; color:#999; } .collect-img img{ display: block; width:90px; height:90px; } .title{ overflow: hidden; font-size:14px; height:40px; line-height: 19px; color:#333; } .price{ font-size:14px; } .price2{ margin-top:5px; } .specs{ margin:5px 0; } .price .van-button{ font-size:12px; margin-left:5px; padding:0 7px; line-height:23px; height:23px; color:#333; border:1px #ddd solid; border-radius:500px; } .float-f{float:left;} .float-r{float:right;} .cl{clear:both;}</style>
    <header class="mui-bar mui-bar-nav" style="background-color: #ffffff;">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">商品收藏</h1>
		</header>
    <div id="member_fav" class="mui-content container">
      <div class="container" style="padding-bottom: 60px;">
        <div class="collect">
        
         #for(product : products)
          <div class="collect-item" id="fav_product_#(product.id)">
            <div class="collect-img">
              <img slot="thumb" src="#(imageUrl(product.image))"></div>
            <div class="collect-R">
              <div class="title">#(product.name)</div>
              <div class="specs">#(product.weight)</div>
              <div class="price" style="color: rgb(42, 101, 170);">
                <div class="float-f price2">￥ #(product.price)</div>
                <div class="float-r">
                  <button class="van-button van-button--button van-button--normal van-button--plain" onclick="location.href='#(product.path)'">
                    <span class="van-button__text">去购买</span></button>
                  <button class="van-button van-button--button van-button--normal van-button--plain deleteFav" productId="#(product.id)">
                    <span class="van-button__text">删除</span></button>
                </div>
                <div class="cl"></div>
              </div>
            </div>
          </div>
          #end
          
        </div>
        <!---->
        <!----></div>
    </div>
  </body>

</html>
<script type="text/javascript" src="#(tpath)/static/js/load.js"></script>
<script type="text/javascript">
$(".deleteFav").on("click",function(){
	var productId = $(this).attr("productId");
	$.ajax({
        url: "#(base)/member/product_fav/delete",
        type: "post",
        data: {"productId":productId},
        dataType: "json",
        success: function(res){
        	if(res.type=="success"){
       			$("#fav_product_"+productId).remove();
       		}
        },
        error: function(res){
        }
    });
});
</script>